<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>File Source for Psa_Plugin_Before_Group_Create.class.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
						<h1>Source for file Psa_Plugin_Before_Group_Create.class.php</h1>
<p>Documentation is available at <a href="../psa/plugins/_plugin_classes---Psa_Plugin_Before_Group_Create.class.php.html">Psa_Plugin_Before_Group_Create.class.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;Abstract&nbsp;class&nbsp;for&nbsp;plugins&nbsp;type&nbsp;of&nbsp;&lt;i&gt;Psa_Plugin_Before_Group_Create&lt;/i&gt;.</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;LICENSE:</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;library&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">&nbsp;*&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;library&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;*&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;See&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">&nbsp;*&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-doc">&nbsp;*&nbsp;along&nbsp;with&nbsp;This&nbsp;library.&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;</span><span class="src-doc-inlinetag">{@link&nbsp;http://www.gnu.org/licenses/}</span><span class="src-doc">&gt;.</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@link</span><span class="src-doc">&nbsp;http://code.google.com/p/phpstartapp/</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Bojan&nbsp;Mauser&nbsp;&lt;bmauser@gmail.com&gt;</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@copyright</span><span class="src-doc">&nbsp;Bojan&nbsp;Mauser&nbsp;2009</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;psa</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@subpackage</span><span class="src-doc">&nbsp;plugins</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@version</span><span class="src-doc">&nbsp;$Id:&nbsp;Psa_Plugin_Before_Group_Create.class.php&nbsp;112&nbsp;2008-09-14&nbsp;00:03:56Z&nbsp;bmauser&nbsp;$</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a27"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a28"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-doc">&nbsp;*&nbsp;Abstract&nbsp;class&nbsp;for&nbsp;plugins&nbsp;type&nbsp;of&nbsp;&lt;i&gt;Psa_Plugin_Before_Group_Create&lt;/i&gt;.</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc">&nbsp;*&nbsp;You&nbsp;can&nbsp;start&nbsp;new&nbsp;group&nbsp;creation&nbsp;process&nbsp;by&nbsp;passing&nbsp;'&lt;kbd&gt;new&lt;/kbd&gt;'&nbsp;to&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group}</span><span class="src-doc">&nbsp;class&nbsp;constructor.&nbsp;See</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group::__construct()&nbsp;constructor}</span><span class="src-doc">&nbsp;method&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group}</span><span class="src-doc">&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a33"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a34"></a><span class="src-doc">&nbsp;*&nbsp;Before&nbsp;a&nbsp;new&nbsp;group&nbsp;is&nbsp;successfully&nbsp;created&nbsp;with&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group::save()&nbsp;save()}</span><span class="src-doc">&nbsp;method&nbsp;of&nbsp;the&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group}</span><span class="src-doc">&nbsp;object,</span></div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;psa_main()}</span><span class="src-doc">&nbsp;method&nbsp;of&nbsp;the&nbsp;plugin&nbsp;object&nbsp;that&nbsp;extends&nbsp;this&nbsp;class&nbsp;will&nbsp;be&nbsp;called.</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc">&nbsp;*&nbsp;You&nbsp;can&nbsp;write&nbsp;&lt;i&gt;Psa_Plugin_Before_Group_Create&lt;/i&gt;&nbsp;plugins&nbsp;by&nbsp;extending&nbsp;this&nbsp;class.&nbsp;Here&nbsp;is&nbsp;an&nbsp;example:</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;*&nbsp;&lt;?php</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc">&nbsp;*&nbsp;class&nbsp;my_plugin&nbsp;extends&nbsp;Psa_Plugin_Before_Group_Create{</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;you&nbsp;have&nbsp;to&nbsp;define&nbsp;psa_main()&nbsp;method&nbsp;in&nbsp;your&nbsp;child&nbsp;class</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function&nbsp;psa_main($group){</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;set&nbsp;some&nbsp;property&nbsp;to&nbsp;new&nbsp;group</span></div></li>
<li><div class="src-line"><a name="a46"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$group-&gt;good_students&nbsp;=&nbsp;'yes';</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;you&nbsp;can&nbsp;put&nbsp;here&nbsp;any&nbsp;logic&nbsp;you&nbsp;need</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-doc">&nbsp;*&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-doc">&nbsp;*&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a51"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a53"></a><span class="src-doc">&nbsp;*&nbsp;When&nbsp;this&nbsp;example&nbsp;plugin&nbsp;is&nbsp;registered&nbsp;every&nbsp;new&nbsp;created&nbsp;group&nbsp;will&nbsp;have&nbsp;property&nbsp;called</span></div></li>
<li><div class="src-line"><a name="a54"></a><span class="src-doc">&nbsp;*&nbsp;&lt;kbd&gt;good_students&lt;/kbd&gt;&nbsp;with&nbsp;value&nbsp;'&lt;kbd&gt;yes&lt;/kbd&gt;'.</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a56"></a><span class="src-doc">&nbsp;*&nbsp;&lt;b&gt;Note:&lt;/b&gt;&nbsp;this&nbsp;plugin&nbsp;is&nbsp;called&nbsp;before&nbsp;the&nbsp;new&nbsp;group&nbsp;is&nbsp;created&nbsp;and&nbsp;saved&nbsp;to&nbsp;database.&nbsp;Because&nbsp;of&nbsp;that</span></div></li>
<li><div class="src-line"><a name="a57"></a><span class="src-doc">&nbsp;*&nbsp;this&nbsp;plugin&nbsp;will&nbsp;be&nbsp;called&nbsp;even&nbsp;if&nbsp;the&nbsp;group&nbsp;is&nbsp;not&nbsp;created&nbsp;due&nbsp;to&nbsp;some&nbsp;error&nbsp;like&nbsp;group&nbsp;with&nbsp;same&nbsp;userneme</span></div></li>
<li><div class="src-line"><a name="a58"></a><span class="src-doc">&nbsp;*&nbsp;already&nbsp;exists&nbsp;in&nbsp;the&nbsp;database.&nbsp;If&nbsp;you&nbsp;set&nbsp;some&nbsp;property&nbsp;to&nbsp;the&nbsp;group&nbsp;like&nbsp;&lt;i&gt;good_students&lt;/i&gt;&nbsp;in</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-doc">&nbsp;*&nbsp;example&nbsp;above&nbsp;and&nbsp;group&nbsp;is&nbsp;successfully&nbsp;created&nbsp;this&nbsp;property&nbsp;will&nbsp;be&nbsp;saved&nbsp;to&nbsp;the&nbsp;database&nbsp;and&nbsp;you&nbsp;don't&nbsp;have&nbsp;to&nbsp;call</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;save()}</span><span class="src-doc">&nbsp;method&nbsp;later&nbsp;to&nbsp;store&nbsp;it.&nbsp;That&nbsp;is&nbsp;unlike&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Plugin_After_Group_Create}</span><span class="src-doc">&nbsp;plugin.</span></div></li>
<li><div class="src-line"><a name="a61"></a><span class="src-doc">&nbsp;*&nbsp;Also,&nbsp;group&nbsp;ID&nbsp;is&nbsp;unknown&nbsp;when&nbsp;this&nbsp;plugin&nbsp;is&nbsp;called&nbsp;and&nbsp;is&nbsp;set&nbsp;after&nbsp;the&nbsp;group&nbsp;is&nbsp;created.</span></div></li>
<li><div class="src-line"><a name="a62"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a63"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;Psa_Group</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;Psa_Group::save()</span></div></li>
<li><div class="src-line"><a name="a65"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;Psa_Group::__construct()</span></div></li>
<li><div class="src-line"><a name="a66"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;Psa_Plugin_Before_User_Create</span></div></li>
<li><div class="src-line"><a name="a67"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a68"></a><span class="src-key">abstract&nbsp;</span><span class="src-key">class&nbsp;</span><a href="../psa/plugins/Psa_Plugin_Before_Group_Create.html">Psa_Plugin_Before_Group_Create</a>&nbsp;<span class="src-key">extends&nbsp;</span><a href="../psa/plugins/Psa_Plugin_Model.html">Psa_Plugin_Model</a><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a70"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a71"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;will&nbsp;be&nbsp;called&nbsp;after&nbsp;new&nbsp;group&nbsp;is&nbsp;successfully&nbsp;created&nbsp;with&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group::save()&nbsp;save()}</span></div></li>
<li><div class="src-line"><a name="a72"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;method&nbsp;of&nbsp;the&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group}</span><span class="src-doc">&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a73"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">Psa_Group&nbsp;</span><span class="src-doc-var">$group_object&nbsp;</span><span class="src-doc">reference&nbsp;to&nbsp;the&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group}</span><span class="src-doc">&nbsp;object&nbsp;whose&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;Psa_Group::save()&nbsp;save()}</span><span class="src-doc">&nbsp;method&nbsp;is&nbsp;invoked</span></div></li>
<li><div class="src-line"><a name="a74"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;Psa_Group::authorize()</span></div></li>
<li><div class="src-line"><a name="a75"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a76"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">abstract&nbsp;</span><span class="src-key">protected&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../psa/plugins/Psa_Plugin_Before_Group_Create.html#methodpsa_main">psa_main</a><span class="src-sym">(</span><span class="src-var">$group_object</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a77"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a78"></a><span class="src-sym">}</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Thu, 21 Oct 2010 01:40:53 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</body>
</html>